import { baseRequest } from "@/utils/request";
const request = (url, ...arg) => baseRequest(`/admin/v1/school/${url}`, ...arg);

export default {
  // 获取人员分页
  schoolPage(data) {
    return request("page", data);
  },
  // 提交表单 edit为true时为编辑，默认为新增
  save(data, edit = false) {
    return request(edit ? "save" : "save", data);
  },
  querySchoolList() {
    return request("queryList");
  },
  delete(data) {
    return request("delete", data);
  },
  clearStudent(data) {
    return request("clearStudent", data);
  },
  batchClearStudent(data) {
    return request("batchClearStudent", data);
  },
  getGradeList(data) {
    return request("getGradeList", data);
  },
  getGradeClassesList(data) {
    return request("getGradeClassesList", data);
  },
  getSchoolGradeClassesList(data) {
    return request("getSchoolGradeClassesList", data);
  },
  summaryData(data) {
    return request("summaryData", data);
  },
  // 人员导出
  userExport(data) {
    return request("export", data, "get", {
      responseType: "blob",
    });
  },
  // 导出人员个人信息
  userExportUserInfo(data) {
    return request("exportUserInfo", data, "get", {
      responseType: "blob",
    });
  },
};
